<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	request.setCharacterEncoding("UTF-8");
	String cp=request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="<%=cp%>/data/css/common.css" rel="stylesheet" type="text/css" />
<link href="<%=cp%>/member/css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=cp%>/data/js/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
function Send() {
	 
	var f = document.form1
	
	if (!f.userId.value) {
        alert("아이디를 입력해주세요");
        form.userId.focus();
        return;
    }
	
    if (!f.userPwd.value) {
        alert("비밀번호를 입력해주세요");
        form.userPwd.focus();
        return;
    }
    
    if (!f.korName.value) {
        alert("한글성명을 입력해 주세요.");
        form.korName.focus();
        return;
    }
    
    if (!f.engName.value) {
        alert("영어성명을 입력해주세요.");
        form.engName.focus();
        return;
    }
    
    if (!f.phone.value) {
        alert("연락처를 입력해주세요.");
        form.phone.focus();
        return;
    }
    
    if (!f.addr.value) {
        alert("주소를 입력해주세요.");
        form.addr.focus();
        return;
    }

    if (!f.email.value) {
        alert("이메일 주소를 입력해주세요.");
        form.email.focus();
        return;
    }
    
    if (!f.birth.value) {
        alert("생년월일을 입력해주세요.");
        form.birth.focus();
        return;
    }
    
    if (!f.gender.value) {
        alert("성별을 선택해주세요.");
        form.gender.focus();
        return;
    }
    
    function checkid() {
    	 
        if (document.f.userId.value == "") {
            alert("중복검사할 아이디를 입력하십시요.");
            document.f.userId.focus();
            return;
        }
    }
    
    if(f.mode.value=="insert"){
    	f.action ="<%=cp%>/member/created.action";
    	f.submit();
	}else if(f.mode.value=="updated"){
		f.action ="<%=cp%>/member/updated.action";	
		f.submit();
	}
    
    if (confirm('입력하신 내용으로 회원가입 하시겠습니까 ?') == true) {
        f.submit();    
    }else {
        return;
    }
}
</script>
</head>
<body>
<div id="container">
<form name="form1" action="<%=cp%>/member/created.action" method="post">
		<!-- Contents -->
		<div id="content3">
			
			<!-- 타이틀 & 로케이션-->
			<div class="titleArea">
				
				<h3><img src="<%=cp%>/member/image/h3_membership_join.gif" alt="회원가입" /><span class="visualImg"><img src="<%=cp%>/member/image/img_visual.gif"  alt="비주얼이미지" /></span></h3>
				<div class="location">
					<a href="/Main/Index"><img src="<%=cp%>/member/image/icon_home.gif" alt="홈" /></a> &gt; <b>회원가입</b>
				</div>
			</div>
			<!-- 타이틀 & 로케이션 // -->
			
			<!-- step -->
			<div class="loginStep"><img src="<%=cp%>/member/image/tab_join_step3.gif" alt="" /></div>
			<!-- step // -->
 
			<!-- 기본정보 영역 -->
			<h4 class="h4Type6"><img src="<%=cp%>/member/image/h4_basic_infor_input.gif" alt="기본정보 입력" /></h4>
			<p class="chechInfor"><img src="<%=cp%>/member/image/img_check.gif" alt="" /> 표시된 항목은 필수입력 정보입니다.</p>
 
			<table cellpadding="0" cellspacing="0" class="tbViewType1" width="100%">
				<colgroup>
					<col width="17%" />
					<col width="33%" />
					<col width="17%" />
					<col width="33%" />
				</colgroup>
				<tbody>
					<tr>
						<th><img src="<%=cp%>/member/image/img_th_email2.gif" alt="이메일" /></th>
						<td colspan="3">
 
		                    <input type="text" name="email" id="CMREM1" size="20" class="type_text2" maxlength="20" value="${dto.email}" /> 예) abc123@gmail.com

						</td>
					</tr>
					<tr>
						<th><img src="<%=cp%>/member/image/img_th_id2.gif" alt="아이디" /></th>
						<td colspan="3">
                            <input type="text" name="userId" id="MBR_ID" class="type_text2" size="19" maxlength="10" style="ime-mode:disabled;" value="${dto.userId}"   />
                            <a href="<%=cp%>/member/idCheck.action" class="styleBtn" ><span class="object">중복검사</span></a> (대소문자 구분, 5~10자 이내)
                            <c:if test="${!empty check}">회원가입이 불가능합니다.</c:if>
                            <input type="hidden" name="id_chk"  id="id_chk"	value="N">
						</td>
					</tr>
					<tr>
						<th><img src="<%=cp%>/member/image/img_th_password2.gif" alt="비밀번호" /></th>
						<td colspan="3">
                            <input type="password" name="userPwd" id="MBR_PWD" size="20" class="type_text2" maxlength="10" 
                           value="${dto.userPwd}" /> (5~10자 이내 영문/숫자 조합으로 아이디, 전화번호는 사용하실 수 없습니다.)</td>
					</tr>
					<tr>
					  <th><img src="<%=cp%>/member/image/img_th_hangul_name2.gif" alt="한글성명" /></th>
					  <td colspan="3"><input type="text" name="korName" id="CMRKNM"  size="20" class="type_text2" maxlength="20" 
					   		value="${dto.korName}"/></td>
				  </tr>
					<tr>
						<th><img src="<%=cp%>/member/image/img_th_en_name2.jpg" alt="영문성명" /></th>
						<td colspan="3"><input type="text" name="engName" id="CMRKNM4"  size="20" class="type_text2" maxlength="20" 
						    value="${dto.engName}"/></td>
					</tr>

					<tr>
						<th><img src="<%=cp%>/member/image/img_th_birth.gif" alt="생년월일" /></th>
						<td colspan="3">
						<input type="text" name="birth" id="CMRKNM2"  size="20" class="type_text2" value="" maxlength="20"
							value="${dto.birth}"  /> 
						  예) 2012년 12월 7일 -&gt; 20121207
						    <select name='gender'  style='width:60px; height:18px; margin-left:30px;'>
						<option value=''>성별</option>
						<option value='1'>남</option>
						<option value='2'>여</option>
						</select>

 
                        </td>
					</tr>
					<tr>
						<th><img src="<%=cp%>/member/image/img_th_hp2.gif" alt="휴대폰" /></th>
						<td colspan="3"><input type="text" name="phone" id="CMRKNM3"  size="20" class="type_text2" value="${dto.phone }" maxlength="20" /> 
						  &quot; - &quot; 없이 숫자만 입력해주세요.</td>
					</tr>
					<tr class="thTop">
						<th class="bgGra"><img src="<%=cp%>/member/image/img_th_address2.gif" alt="주소" /></th>
						<td colspan="3" class="dwelling"><p class="dwellingDetail">
							<span class="title1"><input type="text" name="addr" id="CMRAD1" size="35" class="type_text2"
								value="${dto.addr}" />
							</span></p>
						</td>
					</tr>
				</tbody>
			</table>
			
			<div class="btnType3">
				<span class="right">
					<a href="JavaScript:Send();"><img src="<%=cp%>/member/image/btn_member_join.gif" alt="회원가입" /></a>
                    &nbsp;
					<img src="<%=cp%>/member/image/btn_cancel2.gif" alt="취소" onclick="cancelConfirm();" style="cursor:pointer;" />
				</span>
	    </div>
			
			<!-- 기본정보 영역 // -->
		</div>
		<!-- Contents //-->
		<input type="hidden" name="mode" value="${mode}"/>
</form>
</div>
</body>
</html>